package com.ys.erp.stage_marketing_service.bean.vo;

import com.fasterxml.jackson.annotation.JsonFormat;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author lwj
 * @date 2023/7/13
 */
@Data
@Accessors(chain = true)
public class CouponVO {

    private Long id;

    @Schema(description = "商品类型")
    private Integer goodsType;

    @Schema(description = "优惠券名字")
    private String couponName;

    @Schema(description = "优惠券类型")
    private Integer couponType;

    @Schema(description = "适用商品类型")
    private Integer suitScopeType;

    @Schema(description = "适用商品分类id集")
    private List<Long> suitGoodsCategoryIds;

    @Schema(description = "适用商品id集")
    private List<Long> suitGoodsIds;

    @Schema(description = "最小消费")
    private String minFee;

    @Schema(description = "优惠金额")
    private String preferentialMoney;

    @Schema(description = "折扣")
    private Integer discount;

    @Schema(description = "赠送商品规格id集")
    private List<Long> giveGoodsSpecsIds;

    @Schema(description = "有效期类型")
    private Integer validType;

    @Schema(description = "有效期天数")
    private Integer validDays;

    @Schema(description = "有效期开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDateTime validStartTime;

    @Schema(description = "有效期结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDateTime validEndTime;

    @Schema(description = "排序")
    private Integer orderNum;

    @Schema(description = "优惠券描述")
    private String couponDescribe;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    @Schema(description = "赠送商品规格集")
    private List<CouponGoodsAndSpecsVO> giveSpecsList;

    @Schema(description = "适用商品集")
    private List<CouponGoodsAndSpecsVO> suitGoodsList;


    @Data
    public static class CouponGoodsAndSpecsVO {

        @Schema(description = "商品id")
        private Long id;

        @Schema(description = "商品图片")
        private String pic;

        @Schema(description = "商品名字")
        private String name;

    }

}
